<template>
  <span
    class="mark-policy"
    v-if="item"
  >{{item.value}}</span>
</template>
<script>

export default {
  name: 'CMarkPolicy',
  props: {
    code: {},
    // [{"key":"MX","value":"不退"}]
    options: {
      type: Array,
      required: true
    }
  },
  computed: {
    item () {
      for (let i = 0; i < this.options.length; i++) {
        const item = this.options[i]
        if ((this.code + '').indexOf(item.key) === 0) {
          return item
        }
      }
      return null
    }
  }
}
</script>
